using System;
using System.Data;
using System.Data.Common;
using EPiServer.Common.Data;

namespace EPiAbstractions.Common.Data
{
    public interface IDatabaseHandlerFacade
    {
        DbConnection GetConnection(Boolean inTransaction);

        void BeginTransaction();

        DbCommand GetCommand(Boolean inTransaction, String sp, Object[] args);

        DbCommand GetCommand(Boolean inTransaction, String sp, CommandType commandType, Object[] args);

        DbCommand GetCommand(String sp, Object[] args);

        DbDataReader GetReader(Boolean inTransaction, String sp, Object[] args);

        DbDataReader GetReader(Boolean inTransaction, String sp, CommandType commandType, Object[] args);

        DbDataReader GetReader(String sp, Object[] args);

        DbDataReader GetReader(String sp, CommandType commandType, Object[] args);

        Object GetScalar(Boolean inTransaction, String sp, Object[] args);

        Object GetScalar(Boolean inTransaction, String sp, CommandType commandType, Object[] args);

        Object GetScalar(String sp, Object[] args);

        Object GetScalar(String sp, CommandType commandType, Object[] args);

        void ExecuteNonQuery(Boolean inTransaction, String sp, CommandType commandType, Object[] args);

        void ExecuteNonQuery(Boolean inTransaction, String sp, Object[] args);

        void ExecuteNonQuery(String sp, CommandType commandType, Object[] args);

        void ExecuteNonQuery(String sp, Object[] args);

        void Rollback();

        void Commit();

        void FinalizeCommand(Boolean inTransaction, DbCommand command);

        void RunInTransaction(TransactionCode transactionCode);
    }
}